UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xSCnzPiK7g+Sbk8vTlbEa9bgeCQuHBn26DJwVBHahT0='
WHERE
key_id = '706aec56135def9dcff884c46a2ff90f855e44135168bbf93fd8b207cea2480c'
AND (
token = 'xSCnzPiK7g+Sbk8vTlbEa9bgeCQuHBn26DJwVBHahT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)