UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VHfdhCGCEGRPgSGEEfs2ui0T+3xQBqATC9ENYc7jX3E=' 
WHERE 
  key_id = '4b6db04ced96855ab8e0de54cc296f097275ea9ed7ffc07f4b5bbfa4644c3222' 
  AND (
    token = 'VHfdhCGCEGRPgSGEEfs2ui0T+3xQBqATC9ENYc7jX3E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017