UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+fXKi/6Fs26JUz/PKaS3prdSmCzVdhTGIoUr0Kl8aWk='
WHERE
key_id = '8abc756fd43e71aa97af798efec8fb2a2b09f5fc7dc53a153b98d4dbd6e07361'
AND (
token = '+fXKi/6Fs26JUz/PKaS3prdSmCzVdhTGIoUr0Kl8aWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)