UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wdLB232/F6+8HnNGHBqE2mr46qnQc2NZELuMZ+vEcMU='
WHERE
key_id = 'e6c561e9307eb20201abdd14e487ba029300f3dfd937b714c3a6fd8b6d6504f8'
AND (
token = 'wdLB232/F6+8HnNGHBqE2mr46qnQc2NZELuMZ+vEcMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)