UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QaxqM9PmiqEJZC0JBM6ksvarovM1sLli2hl/ZuYBmBA='
WHERE
key_id = '4cf6b1a93a17fe51ef78202fb2cecb1ea6dd511be03bb83e33685aeb7c70517b'
AND (
token = 'QaxqM9PmiqEJZC0JBM6ksvarovM1sLli2hl/ZuYBmBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)