UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+D+V5eIkQ997nK0DW78ON85pOSOAOk78adtGx1TF0Fc='
WHERE
key_id = '1531d60f8e6602a88b6c9caf3ec110abe941c62898274e873c24c04ca261fd7c'
AND (
token = '+D+V5eIkQ997nK0DW78ON85pOSOAOk78adtGx1TF0Fc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)