UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kjxXurrOCkufTfOHJRlrxYELhPzjT+po4pK+nppOjLk=' 
WHERE 
  key_id = '807e240696d3c169310ca7f8aa0892d799dfe735d75f4681a7ed7bc4997155f1' 
  AND (
    token = 'kjxXurrOCkufTfOHJRlrxYELhPzjT+po4pK+nppOjLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028