UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Co4OSr/XOchzaYVFL1sxPyo7YkCgsS4sgNhhBdo/jpI=' 
WHERE 
  key_id = '1cb9d87b0efbf3c309606cda9c66809d536fc0de23bf0829b4a2bf3ec46eb0a0' 
  AND (
    token = 'Co4OSr/XOchzaYVFL1sxPyo7YkCgsS4sgNhhBdo/jpI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018