UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Krg4Pu6K0JolGFH7zexuBe8NHvgEmh7D3+Dm2sGGwEQ=' 
WHERE 
  key_id = '8abd925360545aad8ce378ac60cde90f2f46cb15b3e030c705072c6dcbbd8414' 
  AND (
    token = 'Krg4Pu6K0JolGFH7zexuBe8NHvgEmh7D3+Dm2sGGwEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048