UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qBSvsUB5P9jgYmqd6csY1vtlL72ak1dHNz9D5rexwHo='
WHERE
key_id = '1134676c3dd2f0ebf9f149c8fe5c32704f9f1670613ad3d9464a70ecda60b6ec'
AND (
token = 'qBSvsUB5P9jgYmqd6csY1vtlL72ak1dHNz9D5rexwHo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)