UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r7dni319VlacTZ5Z6QGfUG2SWYpyGXjWuG3mWzTZCb0=' 
WHERE 
  key_id = '01fe3cbb1f7b8c3806dc309d9695bd011cb307dbe48a2d1805c6cea6e493fa45' 
  AND (
    token = 'r7dni319VlacTZ5Z6QGfUG2SWYpyGXjWuG3mWzTZCb0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036