UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NBnweTf9CbyGEdR2UYSS9kRXQpB369rXpzGz3XKTwQA=' 
WHERE 
  key_id = '7d0ba57adcbe96ef079dfbe815fad610c52dbe74f9248d170d90a0dcb248f267' 
  AND (
    token = 'NBnweTf9CbyGEdR2UYSS9kRXQpB369rXpzGz3XKTwQA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016