UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0XnBXiJhQZL3/6+xYbJCRbtbul3Mq1jG/NTJ9MiSXG4='
WHERE
key_id = '4b2a631b6c347b280cc9d7c294d36c297064c7ed0ce775188423810c722e553d'
AND (
token = '0XnBXiJhQZL3/6+xYbJCRbtbul3Mq1jG/NTJ9MiSXG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)