UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DYwrfkgIzADlNxZERf+Ae7JQngwPtUWoPGMmCIqUIqg='
WHERE
key_id = 'c770c1a87c3c080514139f52dec9d9b5dcd70313260858768a57f872dece5934'
AND (
token = 'DYwrfkgIzADlNxZERf+Ae7JQngwPtUWoPGMmCIqUIqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)