UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q5JCn9gHzbfgdIysP0qzQLFtsvtcdgoLinuqBTp2Umo='
WHERE
key_id = 'd1b0c36e4895e9a55264fc65ea11a07a4ab86fb7a4d5ae128f75ec7db5d1fff2'
AND (
token = 'q5JCn9gHzbfgdIysP0qzQLFtsvtcdgoLinuqBTp2Umo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)