UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wsrMj13M3Gak1uJVEjlMcvVJ7eagwNyiYyUu1pGXrM8=' 
WHERE 
  key_id = '6476b4785ccab0d88f2abf011ad178777aad438fa4ad0f6c13a9ff7ad3e483fc' 
  AND (
    token = 'wsrMj13M3Gak1uJVEjlMcvVJ7eagwNyiYyUu1pGXrM8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039