UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kFR8bw3kO+q5jKkRddZAmnBoqMLViEIOpkiD3cj4z0g=' 
WHERE 
  key_id = 'eab237739c4e468cf5121a2fa952f3b92908cd8d64c27b270dadb29405534d47' 
  AND (
    token = 'kFR8bw3kO+q5jKkRddZAmnBoqMLViEIOpkiD3cj4z0g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027