UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MyRc4fNxu/xI4wKjzROo2/W1zKl0q8AMio9V0Jw8J6A=' 
WHERE 
  key_id = '739ddbb6a8ac8c4f5faf59c9a75c7a545098b5e823754843ce6cf460982be849' 
  AND (
    token = 'MyRc4fNxu/xI4wKjzROo2/W1zKl0q8AMio9V0Jw8J6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041