UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XqVChjUMKBVErNtI3yMCtIptP0FRxOG2Z3b5Iw0IKFQ='
WHERE
key_id = '863c2b0dd10900e3ef5a2bf0afa0f6f431618f76f320e8a43ad08e7d848543ee'
AND (
token = 'XqVChjUMKBVErNtI3yMCtIptP0FRxOG2Z3b5Iw0IKFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)