UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VseHvxbCZY1y1YDlwewqaZcDttHB2gcyQM5hHPOIb3I='
WHERE
key_id = '9bc157e80e279af61378c32ae7a7d6e0d714423857c3378604ec449547bee9f6'
AND (
token = 'VseHvxbCZY1y1YDlwewqaZcDttHB2gcyQM5hHPOIb3I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)