UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/gMi6knZc5bX8Fy3Mg3ILaSdGBlgSRuebZlKCUegeHA='
WHERE
key_id = '3d7ea42feccefc4ed5c44076dd84708e0487436c6f0f08289ce8226ae8a68dad'
AND (
token = '/gMi6knZc5bX8Fy3Mg3ILaSdGBlgSRuebZlKCUegeHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)