UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NCbZ4Syg8gSdL7L/3atNWO+IbGcvs6ojCjVNZMMTh68='
WHERE
key_id = '3dee0a7d744ec9f407065fb02b9901982fd97f1962a3a31a2584104612b89491'
AND (
token = 'NCbZ4Syg8gSdL7L/3atNWO+IbGcvs6ojCjVNZMMTh68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)