UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sv8zxo4LXTfIYYFLLbv6n5HDPduH1xaRaz9+JroST/g='
WHERE
key_id = 'b74b96bc7d63395b6cff6b102835bf8eb9ff2a74f7a4c02e80c0fdd89732cfc8'
AND (
token = 'Sv8zxo4LXTfIYYFLLbv6n5HDPduH1xaRaz9+JroST/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)