UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZLybMwufSecZHIEmvhdGnpx+snNkx1XyUJGTXvgUtj0='
WHERE
key_id = 'fbf3579fed2b0249f9ec0067027c87bcf41a74ee4be3582c7c6b72bd04ae4237'
AND (
token = 'ZLybMwufSecZHIEmvhdGnpx+snNkx1XyUJGTXvgUtj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)