UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QFUGBhKZQ3srAqqfusEnTAvb13/7o3xexnJizbSBOrY=' 
WHERE 
  key_id = '249b30852eb52186af986c2f5b9dc32cce43780915da5b93fd19d64f72bf5913' 
  AND (
    token = 'QFUGBhKZQ3srAqqfusEnTAvb13/7o3xexnJizbSBOrY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044