UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5xHOFyURLIzWjYqz1ab2RjEq/MYJtB2kQQJsWQXWzZM=' 
WHERE 
  key_id = '71256c81326c3410792921c27861f4c4167bd2b649b609ab31763069d6daf817' 
  AND (
    token = '5xHOFyURLIzWjYqz1ab2RjEq/MYJtB2kQQJsWQXWzZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040