UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CvhJtwC56b9/8lpUlfz+KOU4EA2JsKOIP0wF/TVKGSo='
WHERE
key_id = 'b1688e4e508081bb224e8516d518d9cc425a33152f88e3b77f6bad548ae0f9ce'
AND (
token = 'CvhJtwC56b9/8lpUlfz+KOU4EA2JsKOIP0wF/TVKGSo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)