UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MXuRLUilpHxnceTr8CnE8yrKbeaz9AcoIh6o7fvqWF8=' 
WHERE 
  key_id = '1993a47e8b51f119db9d0cf718b027d911aa4840615e1ac5bb5ce275001a5a2c' 
  AND (
    token = 'MXuRLUilpHxnceTr8CnE8yrKbeaz9AcoIh6o7fvqWF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052