UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zh7Eaicstyn7YcRQvYp2dY2qifq0+tPAgVVDJTfdcOU=' 
WHERE 
  key_id = '86d53bab6bb61e282f8e91a7d0fda8c53db490dfe9d5d2162aec8d6a793f1b92' 
  AND (
    token = 'zh7Eaicstyn7YcRQvYp2dY2qifq0+tPAgVVDJTfdcOU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020