UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BbmY0lAfMs71xqF2DxaxYoyZcABIdl7/2Cjug571p8A=' 
WHERE 
  key_id = 'db37428a886928c12c0b175aeb18f1844e94d7381e8cb782bd40aa991a2be0ab' 
  AND (
    token = 'BbmY0lAfMs71xqF2DxaxYoyZcABIdl7/2Cjug571p8A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036