UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SLPWiR16jV/9pjNMPRt8Y5Y8dDOvpZ1tNkarl9MKFB4='
WHERE
key_id = 'f0250985ec0025320f14e9c1a1327f1804c00bbcfdc1348b1ee867c08b5dba43'
AND (
token = 'SLPWiR16jV/9pjNMPRt8Y5Y8dDOvpZ1tNkarl9MKFB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)