UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cVXTlqKvzVoTA18MzJNRUxCHzyLZ4MqQa2VKToH4Vvg='
WHERE
key_id = '45f2e05846e512b58271ac2450b59bf687cb2ea64e4858d2d2f055c741f348b2'
AND (
token = 'cVXTlqKvzVoTA18MzJNRUxCHzyLZ4MqQa2VKToH4Vvg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)