UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'chygK0qozMIuxXOJ7+NJsyiDsHV2EFzjXvHtXrQFnS8=' 
WHERE 
  key_id = 'ea9d8391917ae0859a203c9b9a6a9ed9fd9ebb71b8f331eb30e2601066927c16' 
  AND (
    token = 'chygK0qozMIuxXOJ7+NJsyiDsHV2EFzjXvHtXrQFnS8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047