UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LyITAjqjNCyaFTr4Zau7V/C6hg2qEpSg2TWwKx4JXBc='
WHERE
key_id = '9e86092c9aa1907035ce7cc17ac3e69811a8687acb912cfb94559d9a495276b8'
AND (
token = 'LyITAjqjNCyaFTr4Zau7V/C6hg2qEpSg2TWwKx4JXBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)