UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0tYYoifV4FFr+YGN5+xQVL2Y7r91qaJJA5LPPcVpeZU=' 
WHERE 
  key_id = '0673815998cf9f1a71a0d4078037fba862cbb35a9ded7e2ecdc4f1ea45156ff5' 
  AND (
    token = '0tYYoifV4FFr+YGN5+xQVL2Y7r91qaJJA5LPPcVpeZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032