UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xgh0YHgn1mObjQrNRAQacfxnresYOp7tk0k/SMxNcG0='
WHERE
key_id = '298427b4a8dee660b7030e2e53090eac472793f07f0d5d2a08d9f8c07d2db4ef'
AND (
token = 'Xgh0YHgn1mObjQrNRAQacfxnresYOp7tk0k/SMxNcG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)