UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g8YDBMd9e8+wPPn1WGSe0CYlsY1DeKBXytbdiUk8jmc='
WHERE
key_id = '62e97bbf383dcc1320117389add0cd5ada1c498f0ab62fa1be8259627a6a021f'
AND (
token = 'g8YDBMd9e8+wPPn1WGSe0CYlsY1DeKBXytbdiUk8jmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)