UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zfBCAIAEjKzJ/l9XNDK76tSe4pABO7knPAWmpNrZmCY='
WHERE
key_id = '7cfa922ef64ff5fa57694412e3025cac5f279aa42a18f70cc687fa232a237647'
AND (
token = 'zfBCAIAEjKzJ/l9XNDK76tSe4pABO7knPAWmpNrZmCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)