UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZTS22H+0jtGoVMx8TwUpjxWj9g0q7QDn+CqAuJY5kq0=' 
WHERE 
  key_id = '63b9af1a8bafb08356a545357a404a9db2bd58f2cfdb4e19627b291f1bce370f' 
  AND (
    token = 'ZTS22H+0jtGoVMx8TwUpjxWj9g0q7QDn+CqAuJY5kq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028