UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3IyQcW/Ce+zW+Raw9ueF8IwduxPP7x761MTQYbwtlgI='
WHERE
key_id = '8f31d17d70ed37c80eaa0a04abdf0ae9d5ccd2de78211d1dd9bb561cc6b41bc2'
AND (
token = '3IyQcW/Ce+zW+Raw9ueF8IwduxPP7x761MTQYbwtlgI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)