UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PDwrKX2MX64tcJBcKtlDKQohCLqdOOPG3glc/MsPQ2k='
WHERE
key_id = 'e79b62c019da3a642b1df84b3b4336cc389101586b2f5b09aa67a63b3b306794'
AND (
token = 'PDwrKX2MX64tcJBcKtlDKQohCLqdOOPG3glc/MsPQ2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)