UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D37Dm6770ghwYaepiXQUP1ZpA/VizDyXRGosdKKtL8U=' 
WHERE 
  key_id = '68305b644cc434653a283fadbce61788ec87aa17c21ffd14f9dc6d357150e78d' 
  AND (
    token = 'D37Dm6770ghwYaepiXQUP1ZpA/VizDyXRGosdKKtL8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027