UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ilTCqmu+fUZsoHY8M4YKWmfxSw2zbk6snmvyNNzzQ4='
WHERE
key_id = '3be8853242a993d674cd5fed46c36531f32c409ad0ee99c8afd473dda3815680'
AND (
token = '1ilTCqmu+fUZsoHY8M4YKWmfxSw2zbk6snmvyNNzzQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)