UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vPAsJw3Xt4K2hzcw9FXCz3vyBKJ2290wC61afRTo77k=' 
WHERE 
  key_id = '481afd9aa438dc46c76b2218a497b657ddbe6ab6c9d18e6eaffff15c6bab7070' 
  AND (
    token = 'vPAsJw3Xt4K2hzcw9FXCz3vyBKJ2290wC61afRTo77k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054