UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WxvkEa0RYBPe79EXT9dnSC8djfeCEHRpetcJOys8dxY='
WHERE
key_id = '9edef5cda0cc0c7c3553414f61fe5ba1abe805da99e69243150ba635d1ebf4df'
AND (
token = 'WxvkEa0RYBPe79EXT9dnSC8djfeCEHRpetcJOys8dxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)