UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '36ULR4SMtTyBrcADBb9NgfbcljTVMrIbv5tjBhZvHB0='
WHERE
key_id = '858f8f549e7c15b7011d16d2d24dc4579c31362b9f4321a6fac5e92363fcff3c'
AND (
token = '36ULR4SMtTyBrcADBb9NgfbcljTVMrIbv5tjBhZvHB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)