UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rXmZWFiv04ODkozFe6DQtONXOGxIpu9zgYw/TIIzcsk=' 
WHERE 
  key_id = '08d96bab95c32bf555c9e5785b3efdd5554c4a7744546d70cc5dff4448e71d6a' 
  AND (
    token = 'rXmZWFiv04ODkozFe6DQtONXOGxIpu9zgYw/TIIzcsk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042