UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vRqt2pTKgq8kbC6WH6hUbx6RxwDEu6Z1I9f40IW8S5w=' 
WHERE 
  key_id = '0f097ccff4132bfe0db2666edd1a9790f126d1715581caea0b96d3cb98b14272' 
  AND (
    token = 'vRqt2pTKgq8kbC6WH6hUbx6RxwDEu6Z1I9f40IW8S5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045