UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4uicL/cgGY/Mcs4l/kRHHO1QNSdubbpQ1vzbPV8HNAc='
WHERE
key_id = '7e226e7440137663ca0b06f7116ea19a6acad5f29923d2b3def68d29e318bc96'
AND (
token = '4uicL/cgGY/Mcs4l/kRHHO1QNSdubbpQ1vzbPV8HNAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)