UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a8b85I9ByEN00zV5cyaKbyLCqsOQ+Sj0R3HPz9bvGsk=' 
WHERE 
  key_id = '783496510b5392ce3be3db85029e33018ac290d94df66a0eb3fadc38f3b3e5ab' 
  AND (
    token = 'a8b85I9ByEN00zV5cyaKbyLCqsOQ+Sj0R3HPz9bvGsk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043