UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZT0A2IEO5siB/oA2jt2W5qiwr5w/phBPmWWbIt19sUM=' 
WHERE 
  key_id = '8e3c464946c705ef464926a52a5770d7eee32cec9ab4bd0459c59cfc66bd3d9c' 
  AND (
    token = 'ZT0A2IEO5siB/oA2jt2W5qiwr5w/phBPmWWbIt19sUM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026