UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wg9lCFPhgGQDtMw3qoOAYyN9J5xvq2QXGqvO+CvQ4do='
WHERE
key_id = '775359e72580e259e3544ea041958eb1555b9bbecdf2e393f46942085944094f'
AND (
token = 'wg9lCFPhgGQDtMw3qoOAYyN9J5xvq2QXGqvO+CvQ4do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)