UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oI1S7hgg0h5OOHIaombt+pqpXg0Gm90/RJIGPswGd7k=' 
WHERE 
  key_id = '50075c43eb80860f789940592f08983b7ead67d3ab299222d5e06183dd890b95' 
  AND (
    token = 'oI1S7hgg0h5OOHIaombt+pqpXg0Gm90/RJIGPswGd7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028