UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UY3uY7mlLkPKUFS+3FP4wRAK5SSPdL1E362STKgWOrg='
WHERE
key_id = '7867728ab3ea81bfc6e072c1ff9c4ad685aa7d6ad77b6ae8b8d98470b0d9f5b1'
AND (
token = 'UY3uY7mlLkPKUFS+3FP4wRAK5SSPdL1E362STKgWOrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)