UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D0H5HvT7XGn7TlFd8UJ8Lr5+EPxkM8l//Gyz6r6a9ts=' 
WHERE 
  key_id = 'a77e05fdd0ea62396891f8ca99734970cc15065790de056df92171d689e97f02' 
  AND (
    token = 'D0H5HvT7XGn7TlFd8UJ8Lr5+EPxkM8l//Gyz6r6a9ts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029