UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'isUuxmkzBp7BcguPmq3hPxq3Hd+cEmB/eq+nXMpRmU4='
WHERE
key_id = '09033a0d49b992e7c9c4ab6dbbde54e0b781a8c1fcd2902e7eee31728f532630'
AND (
token = 'isUuxmkzBp7BcguPmq3hPxq3Hd+cEmB/eq+nXMpRmU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)