UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's+r/ATeJbiFhqZvcIHO5/mpneHYh6YkDHs/BXUQ9tyY='
WHERE
key_id = 'aa11f830f77ff06e115b312e5f27e7dcbb648d222f4bc09806b88e6dba31f538'
AND (
token = 's+r/ATeJbiFhqZvcIHO5/mpneHYh6YkDHs/BXUQ9tyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)